/**
 * @file ImageRegisterSharedState.h
 * @author  Sacco Cosimo <cosimosacco@gmail.com>, Silvestri Davide <davidesil.web@gmail.com>
 *
 * @section LICENSE
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef IMAGEREGISTERSHAREDSTATE_H
#define IMAGEREGISTERSHAREDSTATE_H

#include <string>
#include <list>
#include <stdio.h>
#include <boost/thread/shared_mutex.hpp>
using namespace std;

class ImageRegisterSharedState
{
public:
	boost::shared_mutex sharedMutex;
	list<string> imageList;
	// Funzione di utilità per la ricerca di una stringa in una lista di stringhe.
    bool findString(string stringToBeSearched)
    {
        list<string>::iterator i = imageList.begin();
        for(; i != imageList.end(); i++)
        {
            if(((*i).compare(stringToBeSearched)) == 0)
            {
                return true;
            }
        }
        return false;
    }
};

#endif //IMAGEREGISTERSHAREDSTATE_H
